package pojos;

import java.util.ArrayList;
import java.util.Collection;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="t_sports")
public class Sport {

	private long id_sport;
	private String nom;
	private String detail;
	private Collection<Voyage> voyages = new ArrayList();
	
	@Id
	public long getId_sport() {
		return id_sport;
	}
	public void setId_sport(long id_sport) {
		this.id_sport = id_sport;
	}
	public String getNom() {
		return nom;
	}
	public void setNom(String nom) {
		this.nom = nom;
	}
	public String getDetail() {
		return detail;
	}
	public void setDetail(String detail) {
		this.detail = detail;
	}

	 @OneToMany(cascade=CascadeType.ALL, mappedBy = "sport")
	public Collection<Voyage> getVoyages() {
		return voyages;
	}
	public void setVoyages(Collection<Voyage> voyages) {
		this.voyages = voyages;
	}

}
